Skip to content

Instantly share code, notes, and snippets.

@judge2020
judge2020 / plot_discord_predictions.py
Created May 18, 2024 04:05 — forked from rebane2001/plot_discord_predictions.py
Simple script to plot your Discord machine-learning predicted age and gender from the data dump.
import glob
import json
from datetime import datetime
from matplotlib import pyplot
age_ts = []
age_keys = ["prob_13_17", "prob_18_24", "prob_25_34", "prob_35_over"]
age_lists = {k:[] for k in age_keys}
gen_ts = []
float getTemp(){
//wait until predefined amount between IC request.
//Dont constantly request, the chip will heat up.
if(millis() - previousTempReading < tempReadingInterval){
Serial.println("Passing temperature reading. This is not the time.");
return;
}
//We cant just request and receive the temperature reading. It takes time on DS18B20 devices.
//For 12bit precision it takes 750ms to finish conversion.
//Only usable for first device on the line
@jrknox1977
jrknox1977 / ollama_dspy.py
Created February 9, 2024 18:06
ollama+DSPy using OpenAI APIs.
# install DSPy: pip install dspy
import dspy
# Ollam is now compatible with OpenAI APIs
#
# To get this to work you must include `model_type='chat'` in the `dspy.OpenAI` call.
# If you do not include this you will get an error.
#
# I have also found that `stop='\n\n'` is required to get the model to stop generating text after the ansewr is complete.
# At least with mistral.
@nikgalushko
nikgalushko / main.go
Created May 10, 2024 11:48
gocrew3 sqlite
package main
import (
"database/sql"
"fmt"
"math/rand"
"os"
"path/filepath"
"time"

Cygwin, MSYS, MSYS2, MinGW, mingw-w64, WSL, WSL2 の違い

名称 役割 説明
MinGW コンパイラ Windows 用の GNU ツールチェーン。
とにかく Windows 用の gcc や GNU ld。
"Windows 用" とは、Windows 上で動作したり、Windows 用のアプリが作れたりすること。
要するに Visual C++ や Clang/LLVM みたいなもの。
mingw-w64 コンパイラ MinGW のフォーク。Win64 向けの改良が加わっており、2021 年現在の主流。
Cygwin POSIX 環境 Windows 用の POSIX 環境。cygwin1.
@frosit
frosit / infectedFiles.md
Created May 5, 2016 22:40
Some commands for finding and clearing infected PHP files

Finding infected files with following bash commands

** Command to list all infected files:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
  • grep -lr --include=*.php "eval" .
  • grep -lr --include=*.php "base64" .

Command to remove malicious code:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'

DIY Quant Investing

DIY Quantitative Stock Market Investing

Dr. Yves J. Hilpisch | The Python Quants & The AI Machine

Saarbruecken, 6. SaarPython Meetup, 30. August 2022

(short link to this Gist: http://bit.ly/spm_diy)

Git for Windowsにpacmanをインストールする

Git for Windowsの環境にMSYS2で使えるパッケージマネージャpacmanをインストールする。

  1. Git Bashを管理者権限で立ち上げる

  2. MSYS2のzstパッケージを解凍するためzstd.exeを/usr/local/binに配置

mkdir -p /usr/local/bin
curl -o /usr/local/bin/zstd.exe -L https://github.com/git-for-windows/git-sdk-64/blob/main/usr/bin/zstd.exe?raw=true
@rebane2001
rebane2001 / plot_discord_predictions.py
Created May 18, 2024 00:18
Simple script to plot your Discord machine-learning predicted age and gender from the data dump.
"""
Simple script to plot your Discord machine-learning predicted age and gender from the data dump.
To use, simply put this script in your activity/analytics/ folder of your Discord data dump and run it.
You may need to install matplotlib first:
pip install -U matplotlib
thrown together by rebane2001
"""